-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Velero analyzer #1366
Velero analyzer #1366
Conversation
7e2669d
to
fb1b4e0
Compare
WIP status
|
822dc53
to
39bb9fd
Compare
status:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, lets try to see if this analyser can achieve the same goal using what both the cluster-resources
and logs
collectors collect. If its possible, we will not need a separate velero
collector implementation
Here is the spec we looked at
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: support-bundle
spec:
collectors:
- clusterResources: {} # Usually omitted since its added by default
- logs:
namespace: velero
analysers:
- velero: {}
f9d80a4
to
b6e8c3c
Compare
adding tests but this runs without the collector now. @banjoh Let's discuss your concerns around client libs, supporting old velero etc go mod tidy added a velero 1.12 but can downgrade this to 1.11 for starters until confirmed internally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The analyser has taken really good shape.
As for using velero client libraries, I see no harm in doing so. My concern was in trying to have different client library versions so as to handle deprecated GVKs (velerov1.BackupRepositoryTypeResti
). I do not see any reason for taking this approach. We can analyse the k8s objects as they are using k8s unstructured type. Here is an example of me using this type instead of the types implemented by velero client library.
We will however need to see how using a different version of velero affects other projects that import troubleshoot as a dependency. go tooling should handle this dependency issue pretty well, but lets test it with some sample "hello world" application.
898ac55
to
7a2a80a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good apart from the Namespace
comment. I think it would need to be changed (removed?) since it contributes to the collector spec which, if we need to remove, might require following a deprecation process
278f23d
to
9899376
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I added some code suggestions
532dbef
to
7ab1ee7
Compare
edfc4ab
to
13a5e68
Compare
* updated schemas * velero analyzer without collector Signed-off-by: Archit Sharma <[email protected]>
Signed-off-by: Archit Sharma <[email protected]>
Signed-off-by: Archit Sharma <[email protected]>
Signed-off-by: Archit Sharma <[email protected]>
Signed-off-by: Archit Sharma <[email protected]>
..better than using unstructured and be the deer in headlights Signed-off-by: Archit Sharma <[email protected]>
Signed-off-by: Archit Sharma <[email protected]>
Signed-off-by: Archit Sharma <[email protected]>
13a5e68
to
a0e1c8c
Compare
# go test -v -timeout 30s -run '^(TestAnalyzeVelero.*)$' github.com/replicatedhq/troubleshoot/pkg/analyze
=== RUN TestAnalyzeVelero_BackupRepositories
=== RUN TestAnalyzeVelero_BackupRepositories/no_backup_repositories
=== RUN TestAnalyzeVelero_BackupRepositories/1_backup_repository_and_1_Ready
=== RUN TestAnalyzeVelero_BackupRepositories/2_backup_repositories_and_1_Ready
=== RUN TestAnalyzeVelero_BackupRepositories/1_backup_repository_and_none_Ready
--- PASS: TestAnalyzeVelero_BackupRepositories (0.00s)
--- PASS: TestAnalyzeVelero_BackupRepositories/no_backup_repositories (0.00s)
--- PASS: TestAnalyzeVelero_BackupRepositories/1_backup_repository_and_1_Ready (0.00s)
--- PASS: TestAnalyzeVelero_BackupRepositories/2_backup_repositories_and_1_Ready (0.00s)
--- PASS: TestAnalyzeVelero_BackupRepositories/1_backup_repository_and_none_Ready (0.00s)
=== RUN TestAnalyzeVelero_ResticRepositories
=== RUN TestAnalyzeVelero_ResticRepositories/no_restic_repositories
=== RUN TestAnalyzeVelero_ResticRepositories/1_restic_repository_and_1_Ready
--- PASS: TestAnalyzeVelero_ResticRepositories (0.00s)
--- PASS: TestAnalyzeVelero_ResticRepositories/no_restic_repositories (0.00s)
--- PASS: TestAnalyzeVelero_ResticRepositories/1_restic_repository_and_1_Ready (0.00s)
=== RUN TestAnalyzeVelero_Backups
=== RUN TestAnalyzeVelero_Backups/no_backups
=== RUN TestAnalyzeVelero_Backups/1_backup_and_1_Completed
=== RUN TestAnalyzeVelero_Backups/1_backup_and_1_Failed
--- PASS: TestAnalyzeVelero_Backups (0.00s)
--- PASS: TestAnalyzeVelero_Backups/no_backups (0.00s)
--- PASS: TestAnalyzeVelero_Backups/1_backup_and_1_Completed (0.00s)
--- PASS: TestAnalyzeVelero_Backups/1_backup_and_1_Failed (0.00s)
=== RUN TestAnalyzeVelero_BackupStorageLocations
=== RUN TestAnalyzeVelero_BackupStorageLocations/no_backup_storage_locations
=== RUN TestAnalyzeVelero_BackupStorageLocations/1_backup_storage_location_and_1_Available
=== RUN TestAnalyzeVelero_BackupStorageLocations/1_backup_storage_location_and_1_Unavailable
--- PASS: TestAnalyzeVelero_BackupStorageLocations (0.00s)
--- PASS: TestAnalyzeVelero_BackupStorageLocations/no_backup_storage_locations (0.00s)
--- PASS: TestAnalyzeVelero_BackupStorageLocations/1_backup_storage_location_and_1_Available (0.00s)
--- PASS: TestAnalyzeVelero_BackupStorageLocations/1_backup_storage_location_and_1_Unavailable (0.00s)
=== RUN TestAnalyzeVelero_DeleteBackupRequests
=== RUN TestAnalyzeVelero_DeleteBackupRequests/no_backup_delete_requests
=== RUN TestAnalyzeVelero_DeleteBackupRequests/backup_delete_requests_completed
=== RUN TestAnalyzeVelero_DeleteBackupRequests/backup_delete_requests_summarize_in_progress
--- PASS: TestAnalyzeVelero_DeleteBackupRequests (0.00s)
--- PASS: TestAnalyzeVelero_DeleteBackupRequests/no_backup_delete_requests (0.00s)
--- PASS: TestAnalyzeVelero_DeleteBackupRequests/backup_delete_requests_completed (0.00s)
--- PASS: TestAnalyzeVelero_DeleteBackupRequests/backup_delete_requests_summarize_in_progress (0.00s)
=== RUN TestAnalyzeVelero_PodVolumeBackups
=== RUN TestAnalyzeVelero_PodVolumeBackups/no_pod_volume_backups
=== RUN TestAnalyzeVelero_PodVolumeBackups/pod_volume_backups
--- PASS: TestAnalyzeVelero_PodVolumeBackups (0.00s)
--- PASS: TestAnalyzeVelero_PodVolumeBackups/no_pod_volume_backups (0.00s)
--- PASS: TestAnalyzeVelero_PodVolumeBackups/pod_volume_backups (0.00s)
=== RUN TestAnalyzeVelero_PodVolumeRestores
=== RUN TestAnalyzeVelero_PodVolumeRestores/no_pod_volume_restores
=== RUN TestAnalyzeVelero_PodVolumeRestores/pod_volume_restores_-_no_failures
=== RUN TestAnalyzeVelero_PodVolumeRestores/pod_volume_restores_-_failures
--- PASS: TestAnalyzeVelero_PodVolumeRestores (0.00s)
--- PASS: TestAnalyzeVelero_PodVolumeRestores/no_pod_volume_restores (0.00s)
--- PASS: TestAnalyzeVelero_PodVolumeRestores/pod_volume_restores_-_no_failures (0.00s)
--- PASS: TestAnalyzeVelero_PodVolumeRestores/pod_volume_restores_-_failures (0.00s)
=== RUN TestAnalyzeVelero_Restores
=== RUN TestAnalyzeVelero_Restores/no_restores
=== RUN TestAnalyzeVelero_Restores/restores_completed
=== RUN TestAnalyzeVelero_Restores/restores_-_failures
--- PASS: TestAnalyzeVelero_Restores (0.00s)
--- PASS: TestAnalyzeVelero_Restores/no_restores (0.00s)
--- PASS: TestAnalyzeVelero_Restores/restores_completed (0.00s)
--- PASS: TestAnalyzeVelero_Restores/restores_-_failures (0.00s)
=== RUN TestAnalyzeVelero_Schedules
=== RUN TestAnalyzeVelero_Schedules/no_schedules
=== RUN TestAnalyzeVelero_Schedules/schedules_configured
=== RUN TestAnalyzeVelero_Schedules/schedules_-_failures
--- PASS: TestAnalyzeVelero_Schedules (0.00s)
--- PASS: TestAnalyzeVelero_Schedules/no_schedules (0.00s)
--- PASS: TestAnalyzeVelero_Schedules/schedules_configured (0.00s)
--- PASS: TestAnalyzeVelero_Schedules/schedules_-_failures (0.00s)
=== RUN TestAnalyzeVelero_VolumeSnapshotLocations
=== RUN TestAnalyzeVelero_VolumeSnapshotLocations/no_volume_snapshot_locations
=== RUN TestAnalyzeVelero_VolumeSnapshotLocations/volume_snapshot_locations_configured
=== RUN TestAnalyzeVelero_VolumeSnapshotLocations/volume_snapshot_locations_-_failures
--- PASS: TestAnalyzeVelero_VolumeSnapshotLocations (0.00s)
--- PASS: TestAnalyzeVelero_VolumeSnapshotLocations/no_volume_snapshot_locations (0.00s)
--- PASS: TestAnalyzeVelero_VolumeSnapshotLocations/volume_snapshot_locations_configured (0.00s)
--- PASS: TestAnalyzeVelero_VolumeSnapshotLocations/volume_snapshot_locations_-_failures (0.00s)
=== RUN TestAnalyzeVelero_Logs
=== RUN TestAnalyzeVelero_Logs/no_logs
=== RUN TestAnalyzeVelero_Logs/logs_-_no_errors_in_node-agent*_pods
=== RUN TestAnalyzeVelero_Logs/logs_-_no_errors_in_velero*_pods
=== RUN TestAnalyzeVelero_Logs/logs_-_errors_in_node-agent*_pods
--- PASS: TestAnalyzeVelero_Logs (0.00s)
--- PASS: TestAnalyzeVelero_Logs/no_logs (0.00s)
--- PASS: TestAnalyzeVelero_Logs/logs_-_no_errors_in_node-agent*_pods (0.00s)
--- PASS: TestAnalyzeVelero_Logs/logs_-_no_errors_in_velero*_pods (0.00s)
--- PASS: TestAnalyzeVelero_Logs/logs_-_errors_in_node-agent*_pods (0.00s)
=== RUN TestAnalyzeVelero_Results
=== RUN TestAnalyzeVelero_Results/no_results
=== RUN TestAnalyzeVelero_Results/results_-_pass
=== RUN TestAnalyzeVelero_Results/results_-_fail
--- PASS: TestAnalyzeVelero_Results (0.00s)
--- PASS: TestAnalyzeVelero_Results/no_results (0.00s)
--- PASS: TestAnalyzeVelero_Results/results_-_pass (0.00s)
--- PASS: TestAnalyzeVelero_Results/results_-_fail (0.00s)
PASS
ok github.com/replicatedhq/troubleshoot/pkg/analyze (cached) |
Signed-off-by: Archit Sharma <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
* add velero analyzer docs for replicatedhq/troubleshoot/pull/1366 --------- Signed-off-by: Archit Sharma <[email protected]>
Description, Motivation and Context
Velero analyzer (
collector)Fixes: #806
discards the need for collector: #1365
Checklist
Does this PR introduce a breaking change?